﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Configuration;

namespace Support
{
    public class ClearCache
    {
        public readonly static string ClearUrl = ConfigurationManager.AppSettings["ClearCache"];
        /// <summary>
        /// 清空项目中的数据缓存
        /// </summary>
        /// <param name="CacheName"> Employees，Dic_Position，Dic_Duty，Dic_ClientLevel，Sys_Role，Sys_RoleLimit，BusinessInfo，SystemMenu，WinSrvSysConfig </param>
        public void ClearCacheManage(string CacheName)
        {
            try
            {
                WebRequest request = WebRequest.Create(ClearUrl + "?entityName=" + CacheName);
                HttpWebResponse response = (HttpWebResponse)request.GetResponse();
                response.Close();
            }
            catch
            { }
        }
    }
}
